/**  
 * @Project Name:DRGsHosp-facade-impl 
 * @Description ：  
 * @File Name:Storge.java  
 * @Package Name:com.dhcc.DRGsHosp.facade.impl  
 * @Date:2018年4月4日上午9:39:26  
 * @Author mazhaoyan 
 * @Version 2.5.0 DHC-DRGs 
 * @Copyright (c) DHC All Rights Reserved.  
 *  
 */
package com.dhcc.DRGsHosp.facade.impl;

import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**  
 * @ClassName: Storge  
 * @Description ：    
 * @Date: 2018年4月4日 上午9:39:26  
 * @Author mazhaoyan 
 * @Version 2.5.0 DHC-DRGs 
 */
public class Storage {
    BlockingQueue<Map<String, Object>> queues = new LinkedBlockingQueue<Map<String, Object>>(50);

    /**
     * 生产
     * 
     * @param p
     *            产品
     * @throws InterruptedException
     */
    public void push(Map<String, Object> p) throws InterruptedException {
    	//System.out.println("组装病例，当前剩余**********：" + queues.size()); 
        queues.put(p);
    }

    /**
     * 消费
     * 
     * @return 产品
     * @throws InterruptedException
     */
    public Map<String, Object> pop() throws InterruptedException {
    	 //System.out.println("获取病例进行分组,当前剩余￥￥￥￥￥￥￥￥￥￥￥￥￥：" + queues.size()); 
        return queues.take();
    }
}
